package com.demo.pojo;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 *
 */
@Setter
@Getter
@Document(collection = "cde_item_v3")
public class MongoInfo  implements Serializable{
    public MongoInfo() {
    }

    private String id;
    private BasicInfo basicInfo;
    private TopicInfo topicInfo;
    private ApplicantInfo applicantInfo;
    private TrialInfo trialInfo;
    private SubjectInfo subjectInfo;
    private DrugInfo drugInfo;
    private Endpoints endpoints;
    private PiInfo piInfo;
    private List<CenterInfo> centerInfo = new ArrayList<>();
    private List<EcInfo> ecInfo= new ArrayList<>();
    private TrialStatusInfo trialStatusInfo;
    private List<TrialResultSubjectInfo> trialResultSubjectInfo= new ArrayList<>();

    public void setCenterInfo(List<CenterInfo> centerInfo) {
        this.centerInfo = centerInfo;
    }
    public List<CenterInfo> getCenterInfo() {
        return centerInfo;
    }

    public void setEcInfo(List<EcInfo> ecInfo) {
        this.ecInfo = ecInfo;
    }
    public List<EcInfo> getEcInfo() {
        return ecInfo;
    }

    public void setTrialResultSubjectInfo(List<TrialResultSubjectInfo> trialResultSubjectInfo) {
        this.trialResultSubjectInfo = trialResultSubjectInfo;
    }
    public List<TrialResultSubjectInfo> getTrialResultSubjectInfo() {
        return trialResultSubjectInfo;
    }


    @Setter
    @Getter
    public static class BasicInfo implements Serializable{
        private String regisNo;
        private String trialStatus;
        private String contact;
        private String firstPubDate;
        private String applicant;
    }

    @Setter
    @Getter
    public static class TopicInfo implements Serializable {
        private String regisNo;
        private String relatedRegisNo;
        private String drugName;
        private String drugFormerName;
        private String drugType;
        private String recordNo;
        private String Indication;
        private String trialTitle;
        private String trialTitle2;
        private String trialProtocolNo;
        private String trialProtocolVersion;
        private String trialProtocolDate;
        private String drugCombinationFlag;
    }

    @Setter
    @Getter
    public static class ApplicantInfo implements Serializable  {
        private List<String> orgName= new ArrayList<>();
        private String name;
        private String tel;
        private String mobile;
        private String email;
        private String address;
        private String zipcode;

        public void setOrgName(List<String> orgName) {
            this.orgName = orgName;
        }
        public List<String> getOrgName() {
            return orgName;
        }
    }

    @Setter
    @Getter
    public static class TrialInfo implements Serializable{
        private String aim;
        private String classify;
        private String stage;
        private String type;
        private String randomize;
        private String blindingMethod;
        private String range;
        private String insure;
        private String dmc;
    }

    @Getter
    @Setter
    public static class SubjectInfo implements Serializable{
        private String age;
        private String gender;
        private String healthFlag;
        private List<String> inGroups= new ArrayList<>();
        private List<String> outGroups= new ArrayList<>();

        public void setInGroups(List<String> inGroups) {
            this.inGroups = inGroups;
        }
        public List<String> getInGroups() {
            return inGroups;
        }

        public void setOutGroups(List<String> outGroups) {
            this.outGroups = outGroups;
        }
        public List<String> getOutGroups() {
            return outGroups;
        }

    }

    @Getter
    @Setter
    public static class A implements Serializable{
        private String nameCN;
        private String usage;
    }

    @Setter
    @Getter
    public static class DrugInfo implements Serializable{
        private List<A> a= new ArrayList<>();
        private List<A> b= new ArrayList<>();

        public void setA(List<A> a) {
            this.a = a;
        }
        public List<A> getA() {
            return a;
        }
        public void setB(List<A> b) {
            this.b = b;
        }
        public List<A> getB() {
            return b;
        }
    }

    @Setter
    @Getter
    public static class Endpoints implements Serializable{

        private List<A> a= new ArrayList<>();
        private List<B> b= new ArrayList<>();

        public void setA(List<A> a) {
            this.a = a;
        }
        public List<A> getA() {
            return a;
        }

        public void setB(List<B> b) {
            this.b = b;
        }
        public List<B> getB() {
            return b;
        }

    }

    @Getter
    @Setter
    public static class B implements Serializable{
        private String criteria;
        private String evaluateDate;
        private String criteriaType;
    }

      @Setter
      @Getter
    public static class Pi implements Serializable{
        private String name;
        private String degree;
        private String title;
        private String tel;
        private String email;
        private String address;
        private String zipcode;
        private String orgName;
    }

    @Getter
    @Setter
    public static class CenterInfo implements Serializable{
        private String name;
        private String pi;
        private String country;
        private String province;
        private String city;
    }

    @Setter
    @Getter
    public static class TrialStatusInfo implements Serializable{
        private String ingroupNumA;
        private String ingroupNumB;
        private String ingroupNumC;
        private String firstICFDate;
        private String firstInGroupDate;
        private String finishDate;
    }

     @Getter
     @Setter
    public static class TrialResultSubjectInfo implements Serializable{
        private String versionNum;
        private String versionDate;
    }

    @Setter
    @Getter
    public static class EcInfo implements Serializable{
        private String name;
        private String result;
        private String approveDate;
    }

    @Getter
    @Setter
    public static class PiInfo implements Serializable{
        private List<Pi> pi= new ArrayList<>();

        public void setPi(List<Pi> pi) {
            this.pi = pi;
        }
        public List<Pi> getPi() {
            return pi;
        }
    }

}
